<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>response内置对象实例</title>
</head>
<body>
设置cookie
  <%
       Cookie c1 = new Cookie("name","Java") ;
       Cookie c2 = new Cookie("password","123456") ;
       // 最大保存时间为180秒
       c1.setMaxAge(180) ;
     //  c2.setMaxAge(180) ;
       // 通过response对象将Cookie设置到客户端           
       response.addCookie(c1) ;
       response.addCookie(c2) ;
  %>
</body>
</html>
